<#include "/macro.include"/>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body class="container-fluid top-container">
<div class="page-content">

    <div class="row">
        <div class="col-md-3">

            <div class="widget-box">
                <div class="widget-header">
                    <h4><i class="icon-tint"></i>${table.functionName}管理</h4>
                </div>
                <div class="widget-body">
                    <div class="widget-main">
                        <div id="treeDiv" class="ztree"></div>
                    </div>
                </div>
            </div>

        </div>

        <div class="col-md-8">

            <div class="widget-box">
                <div class="widget-header">
                    <h5 class="widget-title"><i class="icon-edit"></i>${table.functionName}编辑</h5>
                    <div class="widget-toolbar">
                        <a id="deleteButton" href="javascript:void(0);" class="btn btn-xs btn-danger" ><i class="icon-trash"></i> 删除</a>
                        <a id="addButton" href="javascript:void(0);" class="btn btn-xs btn-success" ><i class="icon-plus"></i> 新增</a>
                    </div>
                </div>

                <div class="widget-body">
                    <div class="widget-main">

                        <form  name="inputForm" id="inputForm" method="post" class="form-horizontal">
                            <input name="id" id="id" type="hidden" />
                            <input name="parentId" id="parentId" type="hidden" />
                            <input type="hidden" name="rank" id="rank" >
                            <#list table.insertColumns as column>
                                <#if column.javaField != "parentId" && column.javaField != "rank" && column.javaField != "innerCode">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">${column.columnRemarkShort}：</label>
                                <div class="col-md-6">
                                    <#if column.dateColumn>
                                        <input type="text" class="form-control datepicker" name="${column.javaField}" value="<@jspEl 'entity.${column.javaField}Str'/>" placeholder="${column.columnRemarkShort}">
                                        <#else>
                                        <input type="text" class="form-control" name="${column.javaField}" value="<@jspEl 'entity.${column.javaField}'/>" placeholder="${column.columnRemarkShort}">
                                    </#if>
                                </div>
                            </div>
                                </#if>
                            </#list>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-2">
                                    <button id="saveBtn" type="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> 提交</button>
                                </div>
                            </div>

                        </form>

                    </div>
                </div>
            </div>

        </div>
    </div>
</div>

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<link rel="stylesheet" href="static/plugin/ztree-3.5/css/zTreeStyle/zTreeStyle.css" />
<script type="text/javascript" src="static/plugin/ztree-3.5/js/jquery.ztree.all-3.5.min.js"></script>

<script type="text/javascript">
    var systemZtree={
        preUrl : '${table.urlPre}',
        rules:{
            <#list table.insertColumns as column>
            ${column.validateString}<#if column_has_next>,</#if>
            </#list>
        }
    };

    $(document).ready(function() {

    });

</script>
<script type="text/javascript" src="static/js/system/system-ztree.js"></script>
<!-- script end -->

</body>
</html>

